Avoid a warning when finalizing toolbars
authorMatthias Clasen <mclasen@redhat.com>
Thu, 2 Dec 2010 04:32:35 +0000 (23:32 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 2 Dec 2010 04:32:35 +0000 (23:32 -0500)
Recent changes cause disposing menus to emit ::deactivate. So better
disconnect the deactivate handler first.

gtk/gtktoolbar.c

index 007d0394679e1fd742cae02ced4e2e9a829a2776..5d914fada449ef4e61d62969b52ba381d928345d 100644 (file)
@@ -3125,8 +3125,12 @@ gtk_toolbar_finalize (GObject *object)
   g_timer_destroy (priv->timer);
   
   if (priv->menu)
-    gtk_widget_destroy (GTK_WIDGET (priv->menu));
-  
+    {
+      g_signal_handlers_disconnect_by_func (priv->menu,
+                                            menu_deactivated, toolbar);
+      gtk_widget_destroy (GTK_WIDGET (priv->menu));
+    }
+
   if (priv->idle_id)
     g_source_remove (priv->idle_id);